-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix like matching with newlines and no wildcard #23404
Conversation
fb43c7a
to
2fa50d1
Compare
Suggested additional tests
cc @tdcmeehan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (docs)
Pull branch, new local doc build, looks good. Thanks!
Nit, suggest adding the PR number to the release note entry
|
2fa50d1
to
fa30369
Compare
@jp-sivaprasad Thanks for the review! I added the first test. The second case I felt the existing newline tests with wildcards provided enough coverage, so I left it out. Also, I see now that you had assigned this issue to yourself. Sorry for not coordinating with you first! |
@rschlussel has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, some little nits.
fa30369
to
300ea9f
Compare
LIKE expressions were not looking past newlines when there was no wild card. That means that certain expressions were incorrectly returning matches when after the newline the input did not match. This change fixes that behavior. For example: SELECT 'foo\nbar' LIKE 'foo'. Previously that query would return "true". Now it will return false.
300ea9f
to
21eb6f0
Compare
@rschlussel has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Description
LIKE expressions were not looking past newlines when there was no wild card. That means that certain expressions were incorrectly returning matches when after the newline the input did not match. This change fixes that behavior. For example:
SELECT 'foo\nbar' LIKE 'foo'.
Previously that query would return "true". Now it will return false.
Motivation and Context
Fixes #23281
Fixes a bug with like expressions incorrectly matching only to a newline when there is no wildcard.
Impact
Like expressions with patterns that do not end in a wildcard may now return false when previously they would return true
Test Plan
unit tests
verification on our production workload
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.